#ifndef _TASK_LORA_
#define _TASK_LORA_
#include "sys_include.h"
typedef enum {
		LORABANDWIDTH_125K,
		LORABANDWIDTH_250K,
		LORABANDWIDTH_500K,
		nLORABANDWIDTH
}LORABANDWIDTH_TYPE;

typedef enum {
		CODINGRATE_45 = 1,
		CODINGRATE_46,
		CODINGRATE_47,
		CODINGRATE_48,
		nCODINGRATE
}LORACODINGRATE_TYPE;
		
#define TX_OUTPUT_POWER                             20        // dBm
		
		
#define LORA_BANDWIDTH                              0         // [0: 125 kHz,
																	  //  1: 250 kHz,
																	  //  2: 500 kHz,
																	  //  3: Reserved]
#define LORA_SPREADING_FACTOR                       7         // [SF7..SF12]
#define LORA_CODINGRATE                             1         // [1: 4/5,
																	  //  2: 4/6,
																	  //  3: 4/7,
																	  //  4: 4/8]
#define LORA_PREAMBLE_LENGTH                        8         // Same for Tx and Rx
#define LORA_SYMBOL_TIMEOUT                         5         // Symbols
#define LORA_FIX_LENGTH_PAYLOAD_ON                  0
#define LORA_IQ_INVERSION_ON                        0

__task void Task_Lora(void);

extern u8 runposition[];
extern u16 sps;
extern u16 dio0runtimes;
extern u16 dio1runtimes;

#endif
